package com.mzxy.mztopline.utils;

import android.accessibilityservice.AccessibilityService;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.WindowManager;

import androidx.fragment.app.FragmentActivity;


public class UtilsHelper {
    /**
     * 获取屏幕宽度
     */

    public static int getScreenWidth(FragmentActivity contsant, AccessibilityService context) {
        WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics outMetrics = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(outMetrics);

        return outMetrics.widthPixels;
    }
}
